import request from '@/utils/request'

// 查询我的项目管理列表
export function listMyManagement(query) {
  return request({
    url: '/management/my/list',
    method: 'get',
    params: query
  })
}
// 获取项目管理详细信息
export function getMyManagement(proId) {
  return request({
    url: '/management/' + proId,
    method: 'get'
  })
}
// 删除项目管理
export function delMyManagement(proId) {
  return request({
    url: '/management/' + proId,
    method: 'delete'
  })
}

// 获取状态字典
export function getStatusDicts() {
  return request({
    url: '/system/dict/data/type/project_status',
    method:'get'
  })
}

// 查询审核(项目id)任务详情
export function getMetting(data) {
  return request({
    url: '/system/task/' + data,
    method:'get'
  })
}
// 新增合同信息
export function addContractInfo(data) {
  return request({
    url: "/contract/information",
    method: "post",
    data: data,
  });
}
// 获取合同信息
export function getContractInfo(data) {
  return request({
    url: '/contract/information/' + data,
    method:'get'
  })
}
// 修改合同信息
export function updateContractInfo(contractId,data) {
  return request({
    url: "/contract/information/edit/" + contractId,
    method: "put",
    data:data
  });
}
// 新增里程碑信息
export function addMilestoneInfo(data) {
  return request({
    url: "/milestone/information",
    method: "post",
    data: data,
  });
}
// 查询里程碑信息列表
export function listMilestoneInfo(data) {
  return request({
    url: '/milestone/information/list/' + data,
    method:'get'
  })
}
// 修改里程碑信息
export function updateMilestoneInfo(data) {
  return request({
    url: "/milestone/information/edit/" + data.milepostId,
    method: "put",
    data:data
  });
}
// 新增初验信息
export function addPreliminaryInfo(data) {
  return request({
    url: "/preliminary/information",
    method: "post",
    data: data,
  });
}
// 获取初验信息
export function getPreliminaryInfo(data) {
  return request({
    url: '/preliminary/information/' + data,
    method:'get'
  })
}
// 修改初验信息
export function updatePreliminaryInfo(firstCheckId,data) {
  return request({
    url: "/preliminary/information/edit/" + firstCheckId,
    method: "put",
    data:data
  });
}

// 新增终验信息
export function addLastCheckInfo(data) {
  return request({
    url: "/lastCheck",
    method: "post",
    data: data,
  });
}
// 获取终验信息
export function getLastCheckInfo(data) {
  return request({
    url: '/lastCheck/' + data,
    method:'get'
  })
}
// 修改终验信息
export function updateLastCheckInfo(lastCheckId,data) {
  return request({
    url: "/lastCheck/edit/" + lastCheckId,
    method: "put",
    data:data
  });
}

// 新增合规审查
export function addComplianceInfo(data) {
  return request({
    url: "/compliance",
    method: "post",
    data: data,
  });
}
// 获取合规审查
export function getComplianceInfo(data) {
  return request({
    url: '/compliance/' + data,
    method:'get'
  })
}
// 修改合规审查
export function updateComplianceInfo(data) {
  return request({
    url: "/compliance/edit/" + data.complianceId,
    method: "put",
    data:data
  });
}

// 新增发改-财政局审批结果备案
export function addFinance(data) {
  return request({
    url: "/finance",
    method: "post",
    data: data,
  });
}
// 获取发改-财政局审批结果备案
export function getFinance(data) {
  return request({
    url: '/finance/' + data,
    method:'get'
  })
}
// 修改发改-财政局审批结果备案
export function updateFinance(data) {
  return request({
    url: "/finance/edit/",
    method: "put",
    data:data
  });
}

// 模版下载
export function downloadTemplate() {
  return request({
    url: 'http://cqaivm.860001.xyz:12241/yzq-approve/'+'信息化项目建议书模板.doc',
    method: 'get'
  })
}

// 查询当前是否有年度计划
export function getAnnualPlan() {
  return request({
    url: '/plan/ifAnnualProject',
    method:'get'
  })
}

/**
 * 
 * @param {查询里程碑完成时间} projectId 
 * @returns {applicationApprovalTime	项目申报通过时间 programApprovalTime	方案审批通过时间}
 */
export function getFinishTimeOfMilestone(projectId) {
  return request({
    url: `/milestone/information/finishTime/${projectId}`,
    method: 'get'
  })
}

// 业主单位字典获取
export function getUnit() {
  return request({
    url: '/annualDeclaration/getUnitAndDept',
    method: 'get'
  })
}
// 责任科室字典获取
export function getDept() {
  return request({
    url: '/annualDeclaration/getUnitAndDept/4',
    method: 'get'
  })
}
// 项目单位撤回
export function getRetreat(proId) {
  return request({
    url: '/management/retreat/' + proId,
    method: 'get'
  })
}